<?php


namespace App\Api\Models\user;


use Illuminate\Database\Eloquent\Factories\HasFactory;
use Illuminate\Database\Eloquent\Model;
use Illuminate\Database\Eloquent\SoftDeletes;

class CmcPointMoney extends Model
{
    use SoftDeletes;
    use HasFactory;
    protected $guarded = [];
    protected $table ='cmc_point_money_record';

    /**
     * 添加和修改
     * @param $data
     * @param array $where
     * @return \Illuminate\Database\Eloquent\Builder|Model|int
     */
    public static function saveData($data,$where = [])
    {
        if (!empty($where) && is_array($where)){
            return self::query()->where($where)->update($data);
        }
        return self::query()->create($data);
    }

}